package com.yhd.admin.utils;

public class ServiceMessage {
	
	private int status; //200 代表成功,500代表失败
	
	//返回的数据
	private Object data;
	
	public ServiceMessage(){}
	
	public ServiceMessage(int status,Object data) {
		this.data = data;
		this.status = status;
	}

	public Object getData() {
		return data;
	}

	public void setData(Object data) {
		this.data = data;
	}
	
	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}
	
	//工具方法
	public static ServiceMessage ok(){
		return new ServiceMessage(200,null);
	}
	
	public static ServiceMessage ok(Object data){
		return new ServiceMessage(200,data);
	}
	
	//工具方法
	public static ServiceMessage fail() {
		return new ServiceMessage(500, null);
	}
}
